using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;

namespace VisualGTest.Binding
{
    /// <summary>
    /// A process implementation using System.Diagnostics.Process .
    /// </summary>
    class Process : IProcess
    {
        private System.Diagnostics.Process m_process;

        public int ExitCode
        {
            get { return m_process.ExitCode; }
        }

        public bool HasExited
        {
            get { return m_process.HasExited; }
        }

        public ProcessStartInfo StartInfo
        {
            get { return m_process.StartInfo; }
            set { m_process.StartInfo = value; }
        }

        public StreamReader StandardError
        {
            get { return m_process.StandardError; }
        }

        public StreamWriter StandardInput
        {
            get { return m_process.StandardInput; }
        }

        public StreamReader StandardOutput
        {
            get { return m_process.StandardOutput; }
        }

        public Process()
        {
            m_process = new System.Diagnostics.Process();
        }

        public bool Start()
        {
            return m_process.Start();
        }

        public void WaitForExit()
        {
            m_process.WaitForExit();
        }

        public bool WaitForExit(int milliseconds)
        {
            return m_process.WaitForExit(milliseconds);
        }

        public void Kill()
        {
            m_process.Kill();
        }

        public void Dispose()
        {
            m_process.Dispose();
        }
    }
}
